package com.mysoft.gfyx.marketdevelop.controller;

import com.mysoft.framework.rpc.annotation.PubAction;
import com.mysoft.framework.rpc.annotation.PubService;
import com.mysoft.framework.rpc.contants.RequestPrefix;
import com.mysoft.gfyx.marketdevelop.controller.dto.inspect.ChartRequestDto;
import com.mysoft.gfyx.marketdevelop.controller.dto.inspect.MultiPieResponseDto;
import com.mysoft.gfyx.marketdevelop.controller.dto.inspect.PieResponseDto;
import com.mysoft.gfyx.marketdevelop.service.*;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

@PubService(value = "/inspectDataApi", prefix = RequestPrefix.API)
@Tag(name = "市场洞察-API")
public class InspectDataApiController {

    @Autowired
    private InspectDeveloperService inspectDeveloperService;

    @Autowired
    private InspectTakeLandService inspectTakeLandService;

    @Autowired
    private InspectProjectService inspectProjectService;

    @Autowired
    private InspectWorkService inspectWorkService;

    @PubAction(value = "/takenLandUsagePie", method = RequestMethod.POST)
    public MultiPieResponseDto searchDeveloper(@RequestBody ChartRequestDto dto) {
        return inspectTakeLandService.takeLandUsagePieByApi(dto);
    }

    @PubAction(value = "/developerTypePie", method = RequestMethod.POST)
    public PieResponseDto developerTypePie(@RequestBody ChartRequestDto dto) {
        return inspectDeveloperService.developerTypePie(dto);
    }

    @PubAction(value = "/projectFitmentPie", method = RequestMethod.POST)
    public MultiPieResponseDto searchEnterpriseName(@RequestBody ChartRequestDto dto) {
        return inspectProjectService.projectFitmentPieByApi(dto);
    }

    @PubAction(value = "/takenLandRank", method = RequestMethod.POST)
    public Object takenLandRank(@RequestBody ChartRequestDto dto) {
        return inspectTakeLandService.takenLandRank(dto);
    }

    @PubAction(value = "/projectRank", method = RequestMethod.POST)
    public Object projectRank(@RequestBody ChartRequestDto dto) {
        return inspectProjectService.projectRank(dto);
    }

    @PubAction(value = "/commenceRank", method = RequestMethod.POST)
    public Object commenceRank(@RequestBody ChartRequestDto dto) {
        return inspectWorkService.commenceRank(dto);
    }

    @PubAction(value = "/takenLandUsageBar", method = RequestMethod.POST)
    public Object takenLandUsageBar(@RequestBody ChartRequestDto dto) {
        return inspectTakeLandService.takenLandUsageBar(dto);
    }

    @PubAction(value = "/projectBar", method = RequestMethod.POST)
    public Object projectBar(@RequestBody ChartRequestDto dto) {
        return inspectProjectService.projectBar(dto);
    }

    @PubAction(value = "/buildingProjectBar", method = RequestMethod.POST)
    public Object buildingProjectBar(@RequestBody ChartRequestDto dto) {
        return inspectProjectService.buildingProjectBar(dto);
    }


    @PubAction(value = "/commencePermitBar", method = RequestMethod.POST)
    public Object commencePermitBar(@RequestBody ChartRequestDto dto) {
        return inspectWorkService.commencePermitBar(dto);
    }

}
